<?php  
include_once '../../models/Model.php';
defined('APPLICATION_URL')||define('APPLICATION_URL', '/ITjap(tung)/ITjap_finalversion');
session_start();
$userId=$_SESSION['userId'];
if(!isset($userId)) header('Location:'.APPLICATION_URL.'/index.php');
$model=new Model();
$user=$model->searchUserById($userId);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<!-- head - Finished -->
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
	<link rel="stylesheet" href="../../css/layout.css" type="text/css" media="screen" />
	<link rel="stylesheet" href="../../css/register.css" type="text/css" media="screen" />	
	<title>会議室予約システム</title>
</head>
<!-- /head - Finished -->

<script type="text/javascript">
	function checkForm()
	{
		var x=document.forms["form1"]["familyName"].value;
		var y=document.forms["form1"]["firstName"].value;
		var z=document.forms["form1"]["address"].value;
		var t=document.forms["form1"]["tel"].value;
		var u=document.forms["form1"]["mail"].value;
		var v=document.forms["form1"]["retypemail"].value;
		
		var atpos=u.indexOf("@");
		var dotpos=u.lastIndexOf(".");
		if (x==null || x=="" || y==null || y=="" || z==null || z=="" ||t==null || t=="" || u==null || u=="" ||v==null || v=="" )
		  {
			  alert("Blank must be filled out");
			  return false;
		  }
		else if (isNaN(t))
		  {
			  alert("Tel should is numeric value");
			  return false;
		  }
		else if (t.charAt(0)!="0")
         {
              alert("Tel should start with 0 ");
              return false
         }
		else if (t.length<10||t.length>11)
        {
             alert("Tel of numberal should 10 or 11 numberal ");
             return false
        }
		else if (atpos<1 || dotpos<atpos+2 || dotpos+2>u.length||dotpos+2==u.length)
		  {
			  alert("Not a valid e-mail address");
			  return false;
		  }
		else if (v!=u)
		  {
			  alert("Retype mail invalid!!!");
			  return false;
		  }
	}
</script>

<body>
<!-- header area -->
<form name="form1" method="post" action="../../controller/changeInfoUser.php" id="form1" onsubmit="return checkForm();">
	<div id="header_area">
	  <div id="header">
	    <div id="header_link_area">
	      <a name="pagetop"></a>
	      <div id="header_appeal"></div>
	      <div id="header_link">
	        <ul>
	           <li class="header_b_1">
                    <a class="header_b_1" href="../../index.php">
                        <img width="56" height="21" alt="ホーム" src="../../images/header/header_b_1.gif">
                    </a>
                 </li>
                 <li class="logout">
                    <a class="header_b_2" href="../../controller/logout.php">
                        <img width="71" height="21" alt="ログイン" src="../../images/header/header_b_5.gif">
                    </a>
                 </li>
                 <li class="header_b_3">
                    <a class="header_b_3" href="Register.php">
                        <img width="155" height="21" alt="新規会員登録" src="../../images/header/header_b_3.gif">
                    </a>
                </li>
                <li class="header_b_4">
                    <a class="header_b_4" href="../../index.php">
                        <img width="82" height="21" alt="お問い合せ" src="../../images/header/header_b_4.gif">
                    </a>
                </li>
	        </ul>
	      </div>
	    </div>
	    <div id="header_title">
	       <img id="SiteHeader1_imgTitle" src="../../images/header/header_sys_title_1.gif" alt="貸会議室予約" style="height:90px;width:795px;border-width:0px;" /> 
	    </div>
	  </div>
	</div>
<!-- header area-->
	
<!-- pan_area -->
	      <div id="pan_area">
	        <div id="pan">
	          <ul>
	            <li>&nbsp;</li>
	          </ul>
	        </div>
	      </div>
<!-- pan_area -->
	  
<!-- /main -->
	<div id="main_top_area">&nbsp;</div>   
	<!-- main_middle_area -->   
	<div id="main_middle_area">
	    <!-- main area-->
		<div id="main_area">		
			<!-- main -->
			<div id="main">
			<!-- navi -->
				      <div id="navi">
				        <ul>
				          <li class="tenanto_yoyaku"><a href="book_room.php" class="navi_b_1"><img src="../../images/navi/tenanto_yoyaku.gif" alt="会議室予約" width="145" height="39" /></a></li>
				          <li class="tenanto_sansho"><a href="view_room.php" class="navi_b_2"><img src="../../images/navi/tenanto_sansho.gif" alt="予約参照" width="145" height="39" /></a></li>
				          <li class="tenanto_setting"><a href="Change_Info.php" class="navi_b_3"><img src="../../images/navi/tenanto_setting.gif" alt="個人情報変更" width="145" height="39" /></a></li>
				          <li class="tenanto_resetpass"><a href="Change_pass.php" class="navi_b_4"><img src="../../images/navi/tenanto_resetpass.gif" alt="パスワード変更" width="145" height="39" /></a></li>

				        </ul>
				      </div>
				   <!-- /navi -->
            <!-- contents -->
            <div id="content">
              <h1><img src="../../images/h1_sys_member_entry.gif" alt="新規会員登録" /></h1>              
              <!-- state -->
              <div id="state">
                	<img id="imgState" alt="状態" src="../../images/member_enrtry_state_1.gif" style="border-width:0px;" />
              </div>
              <!-- state -->              
              <!-- card -->
              <div class="user_entry">
                <p class="user_entry">必要事項を記入し、［登録内容の確認］ボタンをクリックします。&nbsp;</p>                
                  <img class="user_entry" src="../../images/member_entry_title.gif" alt="新規会員登録" />
                <table class="user_entry">                  
                
                  
                  <tr>
                    <th>お名前<br /><span> ［必須］</span></th>
                    <td>
                      <label>
                       	 （姓）<input name="userForm$tbFamilyName" type="text" maxlength="20" id="userForm_tbFamilyName" class="width_20" value="<?php echo $user->getUserAccName();?>"/>&nbsp;&nbsp;（名）
                        <input name="userForm$tbFirstName" type="text" maxlength="20" id="userForm_tbFirstName" class="width_20" value=<?php echo $user->getUserName();?> />                        
                        <span id="userForm_rfvFamilyName" style="color:Red;display:none;"><br />姓を入力してください。</span>
                        <span id="userForm_rfvFirsName" style="color:Red;display:none;"><br />名を入力してください。</span>
                      </label>
                    </td>
                  </tr>
                  
                  <tr>
                    <th>住所<br /><span> ［必須］</span></th>
                    <td>
                      <input name="userForm$tbAddress" type="text" maxlength="50" id="userForm_tbAddress" class="width_50" />                      
                      <span id="userForm_rfvAddress" style="color:Red;display:none;"><br />住所を入力してください。</span>
                    </td>
                  </tr>
                  <tr>
                    <th>TEL<br /><span> ［必須］</span></th>
                    <td>
                      <input name="userForm$tbTel" type="text" maxlength="15" id="userForm_tbTel" class="width_15" value="<?php echo $user->getUserTel();?>"/>                      
                      <span id="userForm_rfvTel" style="color:Red;display:none;">電話番号を入力してください。</span>
                    </td>
                  </tr>
                                   
                  <tr>
                    <th>メールアドレス<br /><span> ［必須］</span></th>
                    <td>
                      <input name="userForm$tbMailAddress" type="text" maxlength="50" id="userForm_tbMailAddress" class="width_50" value="<?php echo $user->getUserEmail();?>"/>                       
                      <br />確認のため以下にメールアドレスをもう一度入力してください。<br />
                      <input name="userForm$tbMailAddress2" type="text" maxlength="50" id="userForm_tbMailAddress2" class="width_50" />
                      <span id="userForm_rfvMailAddress" style="color:Red;display:none;"><br />メールアドレスを入力してください。</span>
                      <span id="userForm_reMailAddress" style="color:Red;display:none;"><br />入力メールアドレスを確認してください。</span>
                      <span id="userForm_cvMailAddress" style="color:Red;display:none;"><br />入力メールアドレスが一致していません。</span>
                    </td>
                  </tr>
                  
                </table>                  
                <div class="button_area">               
                   <input type="submit" name="btnConfirm" value="登録内容の確認" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;btnConfirm&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))" id="btnConfirm" />         
                </div>
              </div>
              <!-- card -->              
            </div>
            <!-- contents -->	    
			</div>
	  		<!-- /main -->	  	
		</div>
		<!-- /main_area-->
	 </div>
	 <!-- /main_middle_area -->
	<div id="main_bottom_area">&nbsp;</div>
<!-- /main -->
      
<!-- FOOTER -->
	<div id="footer_area">
	  <div id="footer">
	    <ul>
	      <li class="left"><a href="../../index.php">ホーム</a></li>
	      <li><a href="../../controller/logout.php">ログアウト</a></li>
	      <li><a href="register.php">個人情報変更</a></li>
	      <li><a href="../../index.php">Q&A</a></li>
	    </ul>
	    <p>Copyright&nbsp;&copy;&nbsp;Team 08</p>
	  </div>
	</div>
<!-- FOOTER -->	
</form>
</body>
</html>